﻿using System;
using System.Data;

namespace org.se.fs.model
{
    public interface IDatabaseManager : IDisposable
    {
        ProviderType ProviderType { get; set; }
        String ConnectionString { get; set; }
        IDbConnection Connection { get; }
        IDbTransaction Transaction { get; }
        IDataReader DataReader { get; }
        IDbCommand Command { get; }
        IDbDataParameter[] Parameters { get; }

        void Open();
        void BeginTransaction();
        void CommitTransaction();
        void CreateParameters(int paramsCount);
        void AddParameters(int index, string paramName, object objValue);
        void CloseReader();
        void Close();
        new void Dispose();

        IDataReader ExecuteReader(CommandType commandType, string commandText);
        DataSet ExecuteDataSet(CommandType commandType, string commandText);
        Object ExecuteScalar(CommandType commandType, string commandText);
        int ExecuteNonQuery(CommandType commandType, string commandText);
        Boolean Ping();
    }
}